﻿using System.Text;
using System.Xml;

namespace Elifart.Library.Serialization
{
    public static class XamlWriter
    {
        #region Static Methods

        public static void Save(object value, string filePath)
        {
            XmlWriterSettings settings = new XmlWriterSettings();
            settings.Encoding = Encoding.UTF8;
            settings.Indent = true;
            settings.NewLineOnAttributes = true;
            settings.CloseOutput = true;

            XmlWriter xmlWriter = XmlWriter.Create(filePath, settings);
            System.Windows.Markup.XamlWriter.Save(value, xmlWriter);
            xmlWriter.Close();
        }

        #endregion
    }
}
